package cn.gs.meta.db.tables;

import java.util.HashMap;
import java.util.Map;
import javax.persistence.*;

// @author gs
@Entity
public class Obj extends ModelBase {

    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "dailyChg", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> dailyChg;
    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "used", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> used;
    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "built", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> built;
    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "usedChg", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> usedChg;
    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "del", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> del;
    @ElementCollection
    @MapKeyColumn(name = "model")
    @Column(name = "cnt")
    @CollectionTable(name = "rep", joinColumns =
    @JoinColumn(name = "obj"))
    private Map<ModelBase, Double> rep;

    public Map<ModelBase, Double> getDailyChg() {
        if (dailyChg == null) {
            dailyChg = new HashMap<>();
        }
        return dailyChg;
    }

    public void setDailyChg(Map<ModelBase, Double> dailyChg) {
        this.dailyChg = dailyChg;
    }

    public Map<ModelBase, Double> getUsed() {
        if (used == null) {
            used = new HashMap<>();
        }
        return used;
    }

    public void setUsed(Map<ModelBase, Double> used) {
        this.used = used;
    }

    public Map<ModelBase, Double> getBuilt() {
        if (built == null) {
            built = new HashMap<>();
        }
        return built;
    }

    public void setBuilt(Map<ModelBase, Double> built) {
        this.built = built;
    }

    public Map<ModelBase, Double> getUsedChg() {
        if (usedChg == null) {
            usedChg = new HashMap<>();
        }
        return usedChg;
    }

    public void setUsedChg(Map<ModelBase, Double> usedChg) {
        this.usedChg = usedChg;
    }

    public Map<ModelBase, Double> getRep() {
        if (rep == null) {
            rep = new HashMap<>();
        }
        return rep;
    }

    public void setRep(Map<ModelBase, Double> rep) {
        this.rep = rep;
    }

    public Map<ModelBase, Double> getDel() {
        if (del == null) {
            del = new HashMap<>();
        }
        return del;
    }

    public void setDel(Map<ModelBase, Double> del) {
        this.del = del;
    }
}
